package com.yyz.zjjcms.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * CmsAttribute entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "cms_attribute", catalog = "zjjcms")
public class CmsAttribute implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 3064940643171221801L;
	private String id;
	private CmsTab cmsTab;
	private Integer type1;
	private Integer type2;
	private String title;
	private String note;
	private Integer number;
	private Integer isnull;
	private Set<Choose> chooses = new HashSet<Choose>(0);

	// Constructors

	/** default constructor */
	public CmsAttribute() {
	}

	/** minimal constructor */
	public CmsAttribute(String id, CmsTab cmsTab, Integer type1, Integer type2,
			String title, String note, Integer number, Integer isnull) {
		this.id = id;
		this.cmsTab = cmsTab;
		this.type1 = type1;
		this.type2 = type2;
		this.title = title;
		this.note = note;
		this.number = number;
		this.isnull = isnull;
	}

	/** full constructor */
	public CmsAttribute(String id, CmsTab cmsTab, Integer type1, Integer type2,
			String title, String note, Integer number, Integer isnull,
			Set<Choose> chooses) {
		this.id = id;
		this.cmsTab = cmsTab;
		this.type1 = type1;
		this.type2 = type2;
		this.title = title;
		this.note = note;
		this.number = number;
		this.isnull = isnull;
		this.chooses = chooses;
	}

	// Property accessors
	@Id
	@Column(name = "Id", nullable = false, length = 36)
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "org.hibernate.id.UUIDGenerator")
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "cms_tab_id", nullable = false)
	public CmsTab getCmsTab() {
		return this.cmsTab;
	}

	public void setCmsTab(CmsTab cmsTab) {
		this.cmsTab = cmsTab;
	}

	@Column(name = "type1", nullable = false)
	public Integer getType1() {
		return this.type1;
	}

	public void setType1(Integer type1) {
		this.type1 = type1;
	}

	@Column(name = "type2", nullable = false)
	public Integer getType2() {
		return this.type2;
	}

	public void setType2(Integer type2) {
		this.type2 = type2;
	}

	@Column(name = "title", nullable = false)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "note", nullable = false)
	public String getNote() {
		return this.note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	@Column(name = "number", nullable = false)
	public Integer getNumber() {
		return this.number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}

	@Column(name = "isnull", nullable = false)
	public Integer getIsnull() {
		return this.isnull;
	}

	public void setIsnull(Integer isnull) {
		this.isnull = isnull;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cmsAttribute")
	public Set<Choose> getChooses() {
		return this.chooses;
	}

	public void setChooses(Set<Choose> chooses) {
		this.chooses = chooses;
	}

}